import {axios} from '@/utils/request'


const fall = '/convertApi'

export function getObj(id) {
  return axios({
    url: fall+`/getInfoById/${id}`,
    method: 'GET'
  })
}

export function addObj(params) {
  return axios({
    url: fall+`/addConvertBills`,
    method: 'POST',
    data: {
      ...params
    }

  })
}

export function putObj(params) {
  return axios({
    url: fall+`/updateConvert`,
    method: 'post',
    data: {
      ...params
    }
  })
}

export function fetchList(params) {
  return axios({
    url: fall+'/queryPage',
    method: 'GET',
    params: {
      ...params
    }
  })
}
/**
 * 删除
 */
export function delectBayId (id){
  return axios({
    url:fall+'/delConvertBillById/'+id,
    method:'GET'
  })
}

/**
 * 客户下拉列表
 * @param
 * @returns {AxiosPromise}
 */
export function baseCustomersDropDown() {
  return axios({
    url: '/baseCustomers/dropDown',
    method: 'GET'
  })
}

/**
 * 供应商下拉列表
 * @param
 * @returns {AxiosPromise}
 */
export function baseSuppliersDropDown() {
  return axios({
    url: '/baseSuppliers/dropDown',
    method: 'GET'
  })
}

/**
 *合同
 * @returns {*}
 */
export function  dropDown() {
  return axios({
    url:'/contractApi/dropDown',
    method:'GET'
  })
}


/**
 * 同意合同
 * @param id
 * @returns {AxiosPromise}
 */
export function agreeContract(id) {
  return axios({
    url: fall + '/agreeConvertBill/' + id,
    method: 'GET'
  })
}

/**
 * 驳回合同
 * @param id
 * @returns {AxiosPromise}
 */
export function rejected(id) {
  return axios({
    url: fall + '/rejected/' + id,
    method: 'GET'
  })
}


/**
 *
 * @param
 * @returns {AxiosPromise}
 */
export function contractDropDown() {
  return axios({
    url: '/contractApi/dropDown',
    method: 'GET'
  })
}


